package com.tms.app.tms;

import android.os.Bundle;
import android.support.annotation.Nullable;

import com.tms.app.tms.app.MyApp;
import com.tms.app.tms.bean.GpsBean;
import com.tms.app.tms.ui.base.ui.BaseListActivity;

import org.xutils.DbManager;
import org.xutils.ex.DbException;
import org.xutils.x;

import java.util.Date;

/**
 * Created by Administrator on 2017/12/4 0004.
 */

public class TestActivity extends BaseListActivity {
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        for (int i = 0; i < 100; i++) {
            GpsBean gpsBean=new GpsBean();
            gpsBean.setLat("45.556");
            gpsBean.setLon("34.9889");
            gpsBean.setPlanId(3234);
            gpsBean.setDriverId(343);
            gpsBean.setCarId(3434);
            gpsBean.setTrailerId(34343);
            gpsBean.setTime(new Date().getTime());
            try {
                DbManager db = x.getDb(MyApp.getDaoConfig());
                if (db == null)
                    return;
                db.save(gpsBean);
            } catch (DbException e) {
                e.printStackTrace();
            }
        }

    }


}
